#include <bits/stdc++.h>
using namespace std;
int n;
const int N = 1e6 + 10;
int primes[N], ans;
bool st[N];

void get_primes(int n) {
	for (int i = 2; i <= n; ++i) {
		if (!st[i]) {
			primes[ans++] = i;
		}
		for (int j = 0; primes[j] <= n / i; ++j) {
			st[primes[j]*i] = true;
			if (i % primes[j] == 0) {
				break;
			}
		}

	}
}

int main() {
	cin >> n;
	get_primes(n);
	cout << ans;
	return 0;
}